/*LICENSE_BEGIN
 * ******************************************************************
 * Copyright 2006 by the Dainamite Robocup-Team at the
 * DAI-Labor, TU-Berlin (www.dai-labor.de)
 * 
 * Members of Dainamite are:
 * Holger Endert
 * Robert Wetzker
 * Thomas Karbe
 * Axel Heßler
 * Philippe Bütter
 * Felix Brossmann
 * 
 * Licensed under the GNU GPL (General Public License) Free Software 
 * License, Version 2. You may use this file only in compliance with 
 * the License. You may obtain a copy of the License at:
 * 
 * http://www.fsf.org/licensing/licenses/gpl.txt
 * ******************************************************************
LICENSE_END*/
package robocup.component.actions;

/**
 * This action is used to set the heterogeneous player types by the coach, and
 * to change the players during game. Generally, it assigns a player-type
 * (<code>PConf</code>) to each own player. An exchange during game 
 * additionally refreshes the agents stamina, effort and recovery values (only 
 * allowed three times per game).
 */
public class ChangePlayerTypeAction extends Action {
	
	/**
	 * The tricot number of the player, to whom a player-type should be 
	 * assigned. This is one of [1,11]. Note that the goalie isn't able to
	 * be heterogeneous.
	 */
	private int _player;

	/**
	 * The id of the player-type, which should be assigned to the player.
	 * This is a integer value from 0 to 6.
	 */
	private int _pType;

	/**
	 * Constructs a new ChangePlayerTypeAction.
	 * 
	 * @param the
	 *            player number (1-11)
	 * @param the
	 *            player type (0-6)
	 */
	public ChangePlayerTypeAction(int player, int pType) {
		this._player = player;
		this._pType = pType;
		this._type = TYPE.COACH_CHANGE_PLAYER_TYPE;
	}

	/**
	 * Returns the actions string representation:
	 * @return (change_player_type &lt;player-num&gt; &lt;player-type&gt;)
	 */
	@Override
	public String toString() {
		StringBuffer buf = new StringBuffer();
		buf.append("(change_player_type ");
		buf.append(this._player);
		buf.append(" ");
		buf.append(this._pType);
		buf.append(")");
		return buf.toString();
	}

	/**
	 * @return Returns the player.
	 */
	public final int getPlayer() {
		return this._player;
	}

	/**
	 * @return Returns the pType.
	 */
	public final int getPType() {
		return this._pType;
	}
}
